package com.ylbh.modules.activity.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ylbh.common.pojo.activity.dto.ActivityGoodsDTO;
import com.ylbh.common.pojo.activity.vo.WholePointActivitiesTimeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 活动商品信息
 *
 * @author mgh
 * @date 2019-04-22 15:25:57
 */
@Mapper
@Repository
public interface SpikeGoodsMapper extends BaseMapper<ActivityGoodsDTO> {

    /**
     *通过活动id  获取活动商品的最后的排序
     * @param activityId
     * @return
     */
    Integer getLastSequence(@Param("activityId") String activityId);

    /**
     * 通过活动id修改活动商品
     * @param activityGoodsDTO
     */
    void updateByActivityId(ActivityGoodsDTO activityGoodsDTO);

    /**
     * 查询商品的赠送比例
     * @param goodsId
     * @return
     */
    String selectGiveIntegralTypeByGoodsId(String goodsId);

    /**
     * 查询出整点分场的开始时间和结束时间
     * @param activityId
     * @return
     */
    WholePointActivitiesTimeVO selectActivityTime(String activityId);

    WholePointActivitiesTimeVO selectActivityTimeById(String id);

    ActivityGoodsDTO selectActivityGoods(String activityId);

    /**
     * 查询活动的状态
     * @param id
     * @return
     */
    String selectActivityState(String id);
}
